package com.mrdeer.web.service.app.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mrdeer.common.entity.app.OrderEntity;
import com.mrdeer.common.entity.dto.OrderEntityDTO;
import com.mrdeer.web.mapper.OrderEntityMapper;
import com.mrdeer.web.service.app.MiniAppOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: xie jianchu
 */
@Slf4j
@Service
public class MiniAppOrderServiceImpl extends ServiceImpl<OrderEntityMapper, OrderEntity> implements MiniAppOrderService {

    @Resource
    private OrderEntityMapper orderEntityMapper;

    @Override
    public OrderEntity add(OrderEntity orderEntity) {
        orderEntityMapper.insert(orderEntity);
        LambdaQueryWrapper<OrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OrderEntity::getCode, orderEntity.getCode());
        return orderEntityMapper.selectOne(lambdaQueryWrapper);
    }

    @Override
    public boolean delete(String id) {
        return false;
    }

    @Override
    public OrderEntity update(OrderEntity orderEntity) {
        return null;
    }

    @Override
    public OrderEntity getById(String id) {
        return null;
    }

    @Override
    public Page<OrderEntity> list(OrderEntityDTO dto) {
        return null;
    }

    @Override
    public LambdaQueryWrapper<OrderEntity> fuzzyQuery(OrderEntityDTO dto) {
        return null;
    }
}
